import React, { Component } from 'react'
import pubsub from "pubsub-js"

export default class Search extends Component {
    render() {
        return (
            <div className="search">
                <input type="text" ref={el => this.input = el} />&nbsp;
                <button onClick={this.search}></button>
            </div>
        )
    }
    search = () => {
        let v = this.input.value;
        pubsub.publish("keywords", v)
    }
}
